package router

import (
	"admin_template/bff/admin/internal/router/v1/system"
	"admin_template/bff/admin/internal/router/v1/system/api"
	"admin_template/bff/admin/internal/router/v1/system/captcha"
	"admin_template/bff/admin/internal/router/v1/system/company"
	"admin_template/bff/admin/internal/router/v1/system/role"
	"admin_template/bff/admin/internal/router/v1/system/rule"
	"admin_template/bff/admin/internal/router/v1/system/sso"
	"admin_template/bff/admin/internal/router/v1/system/user"
	"github.com/cloudwego/hertz/pkg/app/server"
	"github.com/hertz-contrib/logger/accesslog"
)

func (r *Router) InitRouter(server *server.Hertz) {
	server.Use(accesslog.New(accesslog.
		WithFormat("[${time}] ${status} - ${latency} ${method} ${path} ${queryParams}")))
	system.Register(server, r.SystemService)
	captcha.Register(server, r.CaptchaService)
	api.Register(server, r.ApiService)
	company.Register(server, r.CompanyService)
	rule.Register(server, r.RuleService)
	role.Register(server, r.RoleService)
	user.Register(server, r.UserService)
	sso.Register(server, r.SSOService)
}
